package com.tarena.demo.luban.all.main.rpc;

import com.tarena.demo.luban.all.main.service.CartService;
import com.tarena.demo.luban.cart.api.CartApi;
import com.tarena.demo.luban.protocol.cart.param.CartDeleteParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class CartApiImpl implements CartApi {

    @Autowired
    CartService cartService;

    @Override
    public Boolean deleteCart(CartDeleteParam param) {
        // 业务调用
        System.out.println("通过RPC远程调用删除购物车");
        cartService.deleteCart(param);
        return true;
    }

    @Override
    public String test(String name) {
        return "你好"+name;
    }
}
